<template>
	<view>
		<scroll-view scroll-y="true">
		<uni-card :is-shadow="false" v-for="(it, index) in refundList">
			<view class="uni-flex uni-row"
				style="padding:10rpx 0;border-bottom:2rpx solid #f5f5f5;justify-content:space-between;">
				<view class="uni-flex uni-row"
					style="justify-content:flex-start;">
					<view>
						<image style="width:40rpx;height:40rpx;"
							src="../../static/image/time.png"></image>
					</view>
					<view>
						<text>{{it.applyTime}}</text>
					</view>
				</view>
				<view style="color:#FF4D4F;font-size:12pt;">
					<text>{{it.refundStatusName}}</text>
				</view>
			</view>
			<view class="uni-flex uni-row" style="padding:10rpx 0;border-bottom:2rpx solid #f5f5f5;">
				<view class="uni-flex uni-column" style="flex-grow:2;">
					<view class="uni-flex uni-row" style="padding:10rpx 0;">
						<view style="color:#181818;">
							<text>收货: </text>
						</view>
						<view style="padding-left:20rpx;color:#7B7B7B;" >
							<view>
								<text>{{it.toShopName}} {{it.toAddress}}</text>
							</view>
						</view>
					</view>
					<view class="uni-flex uni-row" style="padding:10rpx 0;" v-show="it.transWay == 1">
						<view  style="color:#181818;">
							<text>货物: </text>
						</view>
						<view style="padding-left:20rpx;color:#7B7B7B;">
							<text v-for="goods in it.cargoList">
								{{goods.name}}*{{goods.count}}
							</text>
						</view>
					</view>
					<view class="uni-flex uni-row" style="padding:10rpx 0;" v-show="it.transWay == 2">
						<view  style="color:#181818;">
							<text>包车</text>
						</view>
					</view>
				</view>
				<view style="display:flex;align-items:center;color:#181818;font-size:12pt;">
					<text style="font-size:9pt;">￥</text><text>{{it.refundFee}}</text>
				</view>
			</view>
			<view>
				<view class="uni-flex uni-row" style="padding:10rpx 0;">
					<view style="color:#181818;">
						<text>退款原因: </text>
					</view>
					<view style="padding-left:20rpx;color:#7B7B7B;" >
						<view>
							<text>{{it.reason}}</text>
						</view>
					</view>
				</view>
				<view class="uni-flex uni-row" style="padding:10rpx 0;"  v-show="it.refundStatus == 91">
					<view style="color:#181818;">
						<text>拒绝原因: </text>
					</view>
					<view style="padding-left:20rpx;color:#7B7B7B;" >
						<view>
							<text>{{it.rejectReason}}</text>
						</view>
					</view>
				</view>
			</view>
		</uni-card>
		<view v-show="no_result" class="uni-flex uni-column"
			style="align-items:center;">
			<view style="margin:50rpx 0;">
				<text>暂无数据</text>
			</view>
		</view>
		</scroll-view>
	</view>
</template>

<script>
	import {post} from "@/util/request.js";
	
	export default {
		data() {
			return {
				no_result: false,
				refundList: [
					{
						applyTime: '',
						refundStatusName: '',
						toShopName: '',
						toAddress: '',
						refundFee: 0.0,
						transWay: 1,
						cargoList: [
							{
								name: '',
								count: 0
							}
						]
						
					}
				]
			}
		},
		onLoad() {
			this.query();
		},
		methods: {
			query() {
				var that = this;
				var userInfo = uni.getStorageSync('userInfo');
				if (userInfo != null && userInfo != '') {
					post('express/refund/query', {
						userId: userInfo.userId
					}).then(res => {
						that.refundList = res.data;
						
						if (that.refundList == null || that.refundList.length <= 0) {
							that.no_result = true;
						} else {
							that.no_result = false;
						}
					});
				} else {
					that.no_result = true;
				}
			}
		}
	}
</script>

<style>

</style>
